package com.module.antiFake.vo;

import java.util.Date;

import base.util.GenFlashClass;

/**
 * AntiFakeWarn entity.
 * @author MyEclipse Persistence Tools
 */

public class AntiFakeWarn implements java.io.Serializable {
	/**
	 * 处理完成;
	 */
	public final static Short PROCESS_STATE_COMPLETE = new Short("1");
	/**
	 * 未处理;
	 */
	public final static Short PROCESS_STATE_ORG = new Short("0");
	
	/**
	 * 不处理
	 */
	public final static Short PROCESS_STATE_FAIL = new Short("-1");
	
	/**
	 * 第一层码扫码异常预警
	 */
	public final static Short TYPE_FIRST_CODE_WARN = new Short("1");
	
	/**
	 * 第二层码扫码异常预警
	 */
	public final static Short TYPE_SECOND_CODE_WARN = new Short("2");
	
	/**
	 * 投诉预警
	 */
	public final static Short TYPE_COMPLAIN_CODE_WARN = new Short("3");
	/**
	 * 窜货预警
	 */
	public final static Short TYPE_TRANSSHIPMENT_WARN = new Short("4");
	
	private Long id;
	private Double longitude;
	private Double latitude;
	private String position;
	private String productId;
	private String productName;
	private String codeInfo;
	private String rollNum;
	private String orgid;
	private String orgName;
	private Short processState;
	private Date createtime;
	private Date processTime;
	private String processId;
	private String processName;
	private Short layerNum;
	private Integer times;
	private Short type;
	private Integer complainId;
	
	/**
	 * 企业未处理的预警数目;
	 */
	private long untreatedNum;
	
	private String batchNo;
	
	private String salesAddr;
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public Double getLongitude() {
		return longitude;
	}
	public void setLongitude(Double longitude) {
		this.longitude = longitude;
	}
	public Double getLatitude() {
		return latitude;
	}
	public void setLatitude(Double latitude) {
		this.latitude = latitude;
	}
	public String getPosition() {
		return position;
	}
	public void setPosition(String position) {
		this.position = position;
	}
	public String getProductId() {
		return productId;
	}
	public void setProductId(String productId) {
		this.productId = productId;
	}
	public String getProductName() {
		return productName;
	}
	public void setProductName(String productName) {
		this.productName = productName;
	}
	public String getCodeInfo() {
		return codeInfo;
	}
	public void setCodeInfo(String codeInfo) {
		this.codeInfo = codeInfo;
	}
	public String getRollNum() {
		return rollNum;
	}
	public void setRollNum(String rollNum) {
		this.rollNum = rollNum;
	}
	public String getOrgid() {
		return orgid;
	}
	public void setOrgid(String orgid) {
		this.orgid = orgid;
	}
	public String getOrgName() {
		return orgName;
	}
	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}
	public Short getProcessState() {
		return processState;
	}
	public void setProcessState(Short processState) {
		this.processState = processState;
	}
	public Date getCreatetime() {
		return createtime;
	}
	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}
	public Date getProcessTime() {
		return processTime;
	}
	public void setProcessTime(Date processTime) {
		this.processTime = processTime;
	}
	public String getProcessId() {
		return processId;
	}
	public void setProcessId(String processId) {
		this.processId = processId;
	}
	public String getProcessName() {
		return processName;
	}
	public void setProcessName(String processName) {
		this.processName = processName;
	}
	
	public Short getLayerNum() {
		return layerNum;
	}
	public void setLayerNum(Short layerNum) {
		this.layerNum = layerNum;
	}
	public static void main(String[] args) {
		GenFlashClass.gen(AntiFakeWarn.class);
	}
	public long getUntreatedNum() {
		return untreatedNum;
	}
	public void setUntreatedNum(long untreatedNum) {
		this.untreatedNum = untreatedNum;
	}
	public Integer getTimes() {
		return times;
	}
	public void setTimes(Integer times) {
		this.times = times;
	}
	
	public Short getType() {
		return type;
	}
	public void setType(Short type) {
		this.type = type;
	}
	
	public Integer getComplainId() {
		return complainId;
	}
	public void setComplainId(Integer complainId) {
		this.complainId = complainId;
	}
	
	public String getBatchNo() {
		return batchNo;
	}
	public void setBatchNo(String batchNo) {
		this.batchNo = batchNo;
	}
	
	public String getSalesAddr() {
		return salesAddr;
	}
	public void setSalesAddr(String salesAddr) {
		this.salesAddr = salesAddr;
	}
	/**
	 * 从扫描记录中复制生成出扫描预警数据
	 * @param scanTime
	 * @return
	 */
	public static AntiFakeWarn copyFromScanTimes(AntiFakeScanTimes scanTime) {
		AntiFakeWarn antiFakeWarn = new AntiFakeWarn();
		antiFakeWarn.setCodeInfo(scanTime.getCodeInfo());
		antiFakeWarn.setCreatetime(new Date());
		antiFakeWarn.setLayerNum(scanTime.getLayerNum());
		antiFakeWarn.setOrgid(scanTime.getOrgid());
		antiFakeWarn.setOrgName(scanTime.getOrgName());
		antiFakeWarn.setProcessState(AntiFakeWarn.PROCESS_STATE_ORG);
		antiFakeWarn.setProductId(scanTime.getProductId());
		antiFakeWarn.setProductName(scanTime.getProductName());
		antiFakeWarn.setRollNum(scanTime.getRollNum());
		antiFakeWarn.setTimes(scanTime.getTimes());
		antiFakeWarn.setType(scanTime.getLayerNum());
		antiFakeWarn.setBatchNo(scanTime.getBatchNo());
		return antiFakeWarn;
	}
	
	/**
	 * 从投诉记录中复制生成出扫描预警数据
	 * @param antiFakeComplain
	 * @return
	 */
	public static AntiFakeWarn copyFromAntiFakeComplain(
			AntiFakeComplain antiFakeComplain) {
		AntiFakeWarn antiFakeWarn = new AntiFakeWarn();
		antiFakeWarn.setCodeInfo(antiFakeComplain.getCodeInfo());
		antiFakeWarn.setOrgName(antiFakeComplain.getOrgName());
		antiFakeWarn.setCreatetime(new Date());
		antiFakeWarn.setLatitude(antiFakeComplain.getLatitude());
		antiFakeWarn.setLongitude(antiFakeComplain.getLongitude());
		antiFakeWarn.setOrgid(antiFakeComplain.getOrgId());
		antiFakeWarn.setProcessState(AntiFakeWarn.PROCESS_STATE_ORG);
		antiFakeWarn.setProductId(antiFakeComplain.getProductId());
		antiFakeWarn.setProductName(antiFakeComplain.getProductName());
		antiFakeWarn.setType(AntiFakeWarn.TYPE_COMPLAIN_CODE_WARN);
		antiFakeWarn.setComplainId(antiFakeComplain.getId());
		antiFakeWarn.setBatchNo(antiFakeComplain.getSysbatch());
		return antiFakeWarn;
	}

}